package ex04;

abstract class Pingmian{
	public abstract double girth();
	public abstract double area();
}
class Circle extends Pingmian{
	private  double r;
	private final double PI=3.14;
	public Circle(double r){
		this.r=r;
	}
	public double girth() {
		return 2*PI*r;
	}
	public double area() {
		return PI*r*r;
	}
}
class Squareness extends Pingmian{
	private double a;
	private double b;
	public Squareness(double a,double b){
		this.a=a;
		this.b=b;
	}
	public double girth() {
		return 2*(a+b);
	}
	public double area() {
		return a*b;
	}
}
class Triangle extends Pingmian{
	private double a;
	private double b;
	private double c;
	private double h;
	public Triangle(double a,double b,double c,double h){
		this.a=a;
		this.b=c;
		this.c=c;
		this.h=h;
	}
	public double girth() {
		return a+b+c;
	}
	public double area() {
		return 1/2*(c*h);
	}
}
